package com.whenjun.util;

import cn.dev33.satoken.context.SaHolder;
import cn.dev33.satoken.stp.StpUtil;
import com.whenjun.common.LoggerParent;

/**
 * @Auther: whenjun
 * @Date: 2023/6/5 0005 18:10
 * @Description:
 */
public class SaTokenUtil extends LoggerParent {

    public static String getRequestId(){
        return SaHolder.getStorage().getString("requestId");
    }

    public static void setRequestId(String requestId){
        SaHolder.getStorage().set("requestId", requestId);
    }

    /**
     * 获取登陆用户的id
     * @return
     */
    public static String getUserId(){
        return (String) StpUtil.getLoginId();
    }
}
